package com.liux.pageflipper;

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.Button;

public class PageFlipperActivity extends Activity{
	    /** Called when the activity is first created. */
	    @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.main);
	        Button bb=new Button(getApplicationContext());
	        WindowManager wm=(WindowManager)getApplicationContext().getSystemService("window");
	        WindowManager.LayoutParams wmParams = new WindowManager.LayoutParams();
	 
	        /**
	         *以下都是WindowManager.LayoutParams的相关属性
	         * 具体用途请参考SDK文档
	         */
	        wmParams.type=2002;   //这里是关键，你也可以试试2003
	        wmParams.format=1;
	         /**
	         *这里的flags也很关键
	         *代码实际是wmParams.flags |= FLAG_NOT_FOCUSABLE;
	         *40的由来是wmParams的默认属性（32）+ FLAG_NOT_FOCUSABLE（8）
	         */
	        wmParams.flags=40;
	        wmParams.width=40;
	        wmParams.height=40;
	        wm.addView(bb, wmParams);  //创建View
	    }
}
